how to group the data by a field into subarray in JavaScript

welcome to shbcf.ru